package com.aiyige.model.request;

import com.aiyige.base.api.ApiManager;

import okhttp3.ResponseBody;
import retrofit2.Call;

/**
 * Created by xiachao on 2018.
 */

public class RefundDetailRequest {

   private String id;
   private String role;

    private RefundDetailRequest(Builder builder) {
        setId(builder.id);
        setRole(builder.role);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getId() {
        return id == null ? "" : id;
    }

    public void setId(String orderId) {
        this.id = orderId == null ? "" : orderId;
    }

    public String getRole() {
        return role == null ? "" : role;
    }

    public void setRole(String role) {
        this.role = role == null ? "" : role;
    }

    public static final class Builder {
        private String id;
        private String role;
        private boolean isBuyer;

        private Builder() {
        }

        public Builder orderId(String val) {
            id = val;
            return this;
        }

        public Builder isBuyer(boolean val) {
            isBuyer = val;
            return this;
        }

        public Call<ResponseBody> build() {
            return ApiManager.getService().orderRefunds(id,isBuyer?"buyer":"seller");
        }

        public Builder id(String val) {
            id = val;
            return this;
        }

        public Builder role(String val) {
            role = val;
            return this;
        }
    }
}
